<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ page  import="java.sql.*" %>
<jsp:useBean id="ObjectSub" class="DAO.DAOAdmin" scope="page" />
<%@taglib prefix="ajax" uri="http://ajaxtags.org/tags/ajax" %>
<script language="javascript">
    function setSubID(id)
    {
        myFormSub.subID.value =  id;
    }

</script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <jsp:include page="../header.jsp" />
        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/front.css"  />

        <title>Themes</title>
    </head>


    <body bgcolor="#154978">

        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="../images/Banner.jpg">

                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2" >
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="28" colspan="2" valign="top" background="../images/top_button.gif">
                            </td>
                        </tr>
                        <tr>
                            <td width="150" height="537" valign="top">

                                <!-- MENU -->
                                <%@include file="menu.jsp" %>
                                <!--END MENU-->	</td>
                            <td width="858" align="center" valign="top" bgcolor="#CCCCCC">
                                <!-- The Start Add Subjec -->
                                <h1 style="color:red"> Sub Subject</h1>
                                <br>
                                <%
                                    int id = Integer.parseInt(request.getParameter("id"));
                                %>
                                <form action="include/actionAddSubSub.jsp" method="post" name="myFormSub">
                                    <input type="hidden" name="subID" value="<%=id%>">
                                    Add subSubject : <input type="text" name="subSubName" />
                                    <input type="submit" value="Add Subjet" />
                                </form>
                                <br>
                                <span id="updateSubSubject"></span>
                                <table border="1" style="border:solid 1px; border-collapse:collapse">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>SubjectID</th>
                                            <th>SubjectName</th>
                                            <th>Status</th>
                                            <th>Editter</th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        <%
                                            ResultSet rss = ObjectSub.selectSubSubjectID(id);
                                            while (rss.next()) {
                                        %>
                                        <tr>
                                            <td><%=rss.getString(1)%></td>
                                            <td><%=rss.getString(2)%></td>
                                            <td><%=rss.getString(3)%></td>
                                            <td>
                                                <a href="include/displaySubSubject.jsp?id=<%=rss.getString(1)%>&<%if (rss.getBoolean(4) == true) {%>display=false<% } else {%>display=true<% }%>&key=<%=id%>">
                                                    <%
                                        if (rss.getBoolean(4) == true) {
                                                    %>
                                                    <img src="images/preview_f2.png" height="20" width="20" border="0"/>
                                                    <% } else {
                                                    %> <img src="images/unpreview_f2.png" height="20" width="20" border="0"/><% }%>
                                                </a>
                                            </td>
                                            <td>
                                                <ajax:anchors target="updateSubSubject" >
                                                    <a href="include/updateSubSubject.jsp?id=<%=rss.getString(1)%>&key=<%=id%>"><img src="../images/button/system/24-tool-a.png" alt="Edit"  border="0"/></a>
                                                    </ajax:anchors>
                                            </td>

                                        </tr>
                                        <% }%>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>
